package org.itboys.store.entity;

import org.itboys.commons.utils.random.RandomUtils;
import org.itboys.mongodb.entity.BaseLongIdEntity;
import org.mongodb.morphia.annotations.Entity;

import java.util.List;

/**
 * Created by huml on 2016/5/20.
 * 订单支付记录
 */
@Entity(value = "StoreOrderPayRecord", noClassnameStored = true)
public class OrderPayRecord extends BaseLongIdEntity {

    private String orderNo;
    private List<Long> orderIds;//关联的订单id集合
    private boolean isPay = false;//是否支付
    private boolean isLock = false;//是否锁定

    public OrderPayRecord(){
        this.orderNo = System.currentTimeMillis() + RandomUtils.getIntRandom(6);
    }

    public List<Long> getOrderIds() {
        return orderIds;
    }

    public void setOrderIds(List<Long> orderIds) {
        this.orderIds = orderIds;
    }

    public boolean isPay() {
        return isPay;
    }

    public void setPay(boolean pay) {
        isPay = pay;
    }

    public boolean isLock() {
        return isLock;
    }

    public void setLock(boolean lock) {
        isLock = lock;
    }

    @Override
    public String toString() {
        return "OrderPayRecord{" +
                "orderIds=" + orderIds +
                ", isPay=" + isPay +
                ", isLock=" + isLock +
                '}';
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
}
